package com.mediacloud.app.newsmodule.activity.military_encyclopedia

import android.text.TextUtils
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.mediacloud.app.assembly.util.loadX
import com.mediacloud.app.model.view.WebBrowser
import com.mediacloud.app.newsmodule.R
import com.mediacloud.app.newsmodule.fragment.imagetext.HtmlFormat


class MilitaryEncyclopediaDialogMeaningAdapter : BaseQuickAdapter<SimpleInfoDtoList,BaseViewHolder>(R.layout.item_bk_dialog_meaning) {
    var isCurrentId :Long = 0
    override fun convert(helper: BaseViewHolder, item:SimpleInfoDtoList) {
        val ivImage = helper.getView<ImageView>(R.id.ivDialogLogo)
        var tvName = helper.getView<TextView>(R.id.tvName)
        tvName.text = item.shortTitle
        if (TextUtils.isEmpty(item.logo)){
            ivImage.visibility = View.GONE
        }else{
            ivImage.visibility = View.VISIBLE
            ivImage.loadX(item.logo,1,1,false,null)
        }
        if (isCurrentId == item.articleId){
            tvName.setTextColor(tvName.context.getColor(R.color.cctv7_red))
        }else{
            tvName.setTextColor(tvName.context.getColor(R.color._222))
        }
    }

}